/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 1rem;
    font-weight: 500;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #fff;
    color: #007bff;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #e6f7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 容器布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

/* 侧边栏样式 */
.sidebar {
    flex: 0 0 250px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: fit-content;
}

.sidebar-menu ul {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #eee;
}

.sidebar-menu li:last-child {
    border-bottom: none;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.sidebar-menu a:hover {
    background-color: #e9f8ff;
    color: #007bff;
    border-left: 3px solid #007bff;
    padding-left: 17px;
}

.sidebar-menu a.active {
    background-color: #e9f8ff;
    color: #007bff;
    border-left: 3px solid #007bff;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    min-height: 600px;
}

.content-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.5rem;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card-body {
    padding: 20px;
}

.card-body p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* 页脚样式 */
.footer {
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
}

.footer-content p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        flex: 0 0 auto;
    }

    .navbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 15px;
    }

    .navbar-user {
        flex-direction: column;
        gap: 10px;
    }
}

/* 动画效果 */
.content-section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 链接样式 */
a {
    cursor: pointer;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 个人信息区域样式 */
.teacher-info {
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.teacher-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.teacher-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

.teacher-name {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.teacher-title {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #007bff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    font-size: 1.2rem;
}

.info-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-detail:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #333;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .teacher-info {
        padding: 20px;
    }

    .teacher-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
}

/* 成功提示框样式 */
.success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 15px;
    z-index: 9999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}

.success-icon {
    font-weight: bold;
    margin-right: 8px;
    font-size: 18px;
}

.success-message {
    font-size: 14px;
}

/* 错误气泡提示样式 */
.error-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(254, 147, 147, 0.2);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #fed7d7;
    color: #e53e3e;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.error-message {
    color: #c53030;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* 进入动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 离开动画 */
.error-tip.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .error-tip {
        right: 10px;
        left: 10px;
        top: 10px;
        max-width: none;
    }
}

/* 查询所带课程样式 */
.courses-container {
    padding: 20px;
}

.semester-filter {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
}

.semester-filter label {
    font-weight: 600;
    color: #333;
}

.semester-filter select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.course-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.course-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.course-code {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.course-details {
    padding: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
    color: #555;
    flex: 0 0 80px;
}

.detail-row .value {
    color: #333;
    text-align: right;
    flex: 1;
}

.no-courses {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-courses p {
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }

    .course-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .semester-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .detail-row .value {
        text-align: left;
    }
}

/* 课程选择下拉框样式 */
.schedule-select {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

.schedule-select:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* 统计表格容器 */
.statistics-container {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #ebeef5;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

/* 统计表格样式 */
.statistics-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 14px;
}

.statistics-table thead {
    background-color: #f5f7fa;
}

.statistics-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #606266;
    border-bottom: 2px solid #ebeef5;
}

.statistics-table td {
    padding: 10px;
    border-bottom: 1px solid #ebeef5;
    color: #606266;
}

.statistics-table tbody tr:hover {
    background-color: #f5f7fa;
}

.statistics-table tbody tr:last-child td {
    border-bottom: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .statistics-table {
        font-size: 12px;
    }

    .statistics-table th,
    .statistics-table td {
        padding: 8px 5px;
    }
}

/* 统计摘要区域 */
.statistics-summary {
    display: flex;
    gap: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

/* 单个统计项 */
.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 统计标签 */
.summary-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

/* 统计值 */
.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #007bff;
}

/* 暂无数据状态 */
.summary-value:contains('暂无数据') {
    color: #6c757d;
    font-style: italic;
    font-weight: 400;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .statistics-summary {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .summary-value {
        font-size: 20px;
    }
}

/* 隐藏成绩录入页面输入框的边框 */
.grade-input,
.date-input {
    border: none;
    outline: none;
    background: transparent;
}

/* 当输入框获得焦点时也保持无边框样式 */
.grade-input:focus,
.date-input:focus {
    border: none;
    outline: none;
    background: transparent;
}

/* 保持表格单元格中的missing-data样式 */
.missing-data {
    color: red;
    font-style: italic;
}

/* 可选：为输入框添加底部边框以保持一定的视觉提示 */
.grade-input,
.date-input {
    border: none;
    border-bottom: 1px dashed #ccc;
    background: transparent;
}

.password-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
}

.form-actions {
    text-align: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

/* 加载动画覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* 加载动画容器 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

